<template>
	<view>
		<text>我是test组件{{msg}}</text>
		<button type="primary" @click="test">我是按钮</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				
			}
		},
		// 组件生命周期
		beforeCreate() {
			console.log("在挂载开始之前被调用")
		},
		mounted() {
			console.log("挂载到实例上去之后调用")
			this.$nextTick(function(){
				// 渲染完毕
				console.log("OK")
			})
		},
		
		
		props:[
			"msg"
		],
		methods: {
			 test()  {
				this.$emit("testclick",{name:"click"});
			}
		}
	}
</script>

<style>

</style>
